package com.skyme.automation.generate.common.widgets;

import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.widgets.Text;

import com.skyme.automation.generate.common.dialog.AbstractDialog;

public class ListenerAppender {

	public static void addTextAreaListener(final Text text,
			final AbstractDialog dialog, boolean selectAll, boolean imeOn) {
		// addFocusListener(text, selectAll, imeOn);
		// addTraverseListener(text);
		if (dialog != null) {
			addModifyListener(text, dialog);
		}
	}

	public static void addModifyListener(final Text text,
			final AbstractDialog dialog) {
		text.addModifyListener(new ModifyListener() {
			public void modifyText(ModifyEvent e) {
				dialog.validate();
			}

		});
	}

}
